import {createApp} from 'vue'
import App from './App.vue'
import router from './router' // 引入 vue-router
import {OpenAPI} from "/@/api/openapi";
// OpenAPI.BASE="http://localhost:8080"
OpenAPI.BASE="https://wechat.xiaowang.link"

// https://pinia.web3doc.top/core-concepts/
// 引入持久化插件
import {store, useUserStore} from "/@/store";

const user = useUserStore();
user.initData();
// import './assets/css/index.css'
import 'animate.css'
// import "/@/utils/websocket"
// import '@bytemd/vue-next/dist/inde'

// 单独引入 ElMessage 和 ElMessageBox 的样式
import * as ElementPlusIconsVue from '@element-plus/icons-vue'


import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/src/message.scss'
import ElementPlus from 'element-plus'
//
// import 'viewerjs/dist/viewer.css'
// import VueViewer from 'v-viewer'

// 移除token信息，方便测试
// localStorage.removeItem(global.USER)
// localStorage.removeItem(global.USERINFO)


// import '@wangeditor/editor/dist/css/style.css' // 引入 css

import "/@/router/permission"
import {global} from "/@/config/global";

const app = createApp(App)
//icon注册
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(store).use(ElementPlus).use(router).mount('#app')
